package com.stox.core.ui.swing.util;

import javax.swing.JLabel;
import javax.swing.SwingUtilities;

public class JLabelTextSetter implements Runnable {

	private static JLabelTextSetter jLabelTextSetter = new JLabelTextSetter();
	
	public static void setText(JLabel label, String text){
		jLabelTextSetter.setLabel(label);
		jLabelTextSetter.setText(text);
		SwingUtilities.invokeLater(jLabelTextSetter);
	}
	
	private JLabel label;
	private String text;
	
	private JLabelTextSetter() {	}
	
	public void run() {
		label.setText(text);
	}

	public JLabel getLabel() {
		return label;
	}

	public void setLabel(JLabel label) {
		this.label = label;
	}

	public String getText() {
		return text;
	}

	public void setText(String text) {
		this.text = text;
	}

}
